package Items
{
	import Events.XMLEvent;
	
	public class Usable extends Item
	{
		protected var duration:int = -1;
		protected var range:int = 0;
		protected var durationCounter:int = 0;
		
		public function get TimeRemaining():int { return this.duration - this.durationCounter;}
		public function get Duration():int {return this.duration;}
		public override function get IsActive():Boolean
		{
			if((this.Duration >= this.durationCounter || this.Duration == -1) &&
				(this.uses > 0 || this.uses == -1))
			{
				return true;
			}
			return false;
		}
		public function Usable(game:Level)
		{
			super(game);
		}
		
		public override function Update(deltaTime:int):void
		{
			super.Update(deltaTime);
			this.durationCounter += deltaTime;
		}
		
		protected override function Initialize():void
		{
			super.Initialize();
		}
	}

}